package com.chookss.view;

import android.content.Context;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chookss.R;
import com.chookss.view.listener.LogHurryDialogListener;

import butterknife.BindView;

public class LogHurryDialog extends BaseDialog {


    @BindView(R.id.tvTiltle)
    TextView tvTiltle;
    @BindView(R.id.tvTiltle2)
    TextView tvTiltle2;
    @BindView(R.id.edContent)
    EditText edContent;
    @BindView(R.id.tvSure)
    TextView tvSure;
    private int type;
    private Context context;
    private LogHurryDialogListener listener=null;
    public LogHurryDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_log_hurry;
    }

    @Override
    protected void init(View view) {
        initCenter(0.3f);
        tvSure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onClick(edContent.getText().toString());
                }
                dismiss();
            }
        });
    }

    public LogHurryDialog(@NonNull Context context, String type, int num,LogHurryDialogListener listener) {
        super(context);
        this.context = context;
        this.listener = listener;
        tvTiltle.setText("给未提交【"+type+"】的员工发送消息提醒");
        tvTiltle2.setText("每日可以发送2次提醒，今日还可以再发送"+(2-num)+"次");
    }
}
